import urllib.request

def getHtml(url):
    html = urllib.request.urlopen(url).read()
    return html
def saveHtml(file_name, file_content):
 with open(file_name + ".html", "wb") as f:
  # 写文件用bytes而不是str，所以要转码
  f.write(file_content)

url="http://www.pxu.edu.cn/"
html = getHtml(url)
saveHtml("D://萍乡学院",html)
